<template>
    <div class="nav">
        <div class="left" @click="handleGoBack"><slot name='left'></slot></div>
        <div class="center"><slot name='center'></slot></div>
        <div class="right"  @click="handleMore"><slot name='right'></slot></div>
    </div>
</template>

<script>
    export default {
        name:"Nav",
        props: {
            gobackpath:{
                type:String,
                default:""
            },
            morepath: {
                type: String,
                default:"", 
            },
        },
        methods: {
            handleGoBack(){
                this.$router.push(this.gobackpath);
            },
            handleMore() {
                console.log(this.morepath);
                this.$router.push(this.morepath);
                
            }
        },
    }
</script>

<style  scoped>
    .nav{
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 9;
         font-size: 20px;
        display: flex;
        height: 64px;
        text-align: center;
        line-height: 64px;
        background-color: #ededed;
    }
    .left, .right{
        font-weight: 700;
        width: 60px;
    }
    .center{
        flex: 1;
    }
    .left,.center,.right{
        margin: 10px;
    }
</style>